import 'package:du_application/model/GoodsModel.dart';
import 'package:du_application/routes/application.dart';
import 'package:flutter/material.dart';

class DetailEvaluate extends StatelessWidget {
  final Comment comment;
  final int id;
  const DetailEvaluate({Key key,this.comment,this.id}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
           InkWell(
             onTap: (){
               Application.router.navigateTo(context, "/evaluate?id=${id}");
             },
             child: Container(
                child: Container(
                  padding: EdgeInsets.symmetric(horizontal: 10),
                  margin: EdgeInsets.only(top: 5),
                  height: 50,
                  color: Colors.white,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Text("商品评价(${comment.count})",
                          style: TextStyle(
                              color: Colors.grey[600], fontSize: 12)),
                      Row(
                        children: <Widget>[
                          Text("全部",
                              style: TextStyle(
                                  color: Colors.grey[600], fontSize: 12)),
                          Icon(
                            Icons.arrow_forward_ios,
                            color: Colors.grey[200],
                            size: 10,
                          ),
                        ],
                      ),
                    ],
                  ),
                ),
              )
           ),
                Container(
                  child: Container(
                    padding: EdgeInsets.symmetric(horizontal: 10),
                    // margin: EdgeInsets.only(top: 5),
                    height: 50,
                    color: Colors.white,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Text("尺码感受",
                            style: TextStyle(
                                color: Colors.grey[600], fontSize: 12)),
                        Row(
                          children:comment.count>0? <Widget>[
                            Text("${comment.commentSize[0].yes/comment.count*100.00}%的人感觉很赞",
                                style: TextStyle(
                                    color: Colors.grey[600], fontSize: 12)),
                          ]:[],
                        ),
                      ],
                    ),
                  ),
                ),
                Container(
                  color: Colors.white,
                  margin: EdgeInsets.only(bottom: 5),
                  padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Container(
                        padding:
                            EdgeInsets.symmetric(horizontal: 10, vertical: 5),
                        child: Text("很赞 (${comment.commentSize[0].yes})"),
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.all(Radius.circular(3)),
                          // border: Border.all(width:1,color:Colors.grey),
                     
                        ),
                      ),
                      Container(
                        padding:
                            EdgeInsets.symmetric(horizontal: 10, vertical: 5),
                        child: Text("偏大 (${comment.commentSize[0].big})"),
                      ),
                      Container(
                        padding:
                            EdgeInsets.symmetric(horizontal: 10, vertical: 5),
                        child: Text("偏小 (${comment.commentSize[0].small})"),
                      ),
                    ],
                  ),
                )
        ],
      ),
    );
  }
}